package com.java.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

/**
 * 供应商产品报价
 * @author Administrator
 *
 */
@Entity
@org.hibernate.annotations.Entity(
		selectBeforeUpdate = true, 
		dynamicInsert = true, 
		dynamicUpdate = true
)
@Table(name="supplier_quotation")
public class SupplierQuotation implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3503667106356235236L;

	@Id
	@GeneratedValue
	private Long id;
	
	/**
	 * 所属供应商
	 */
	@ManyToOne
	@JoinColumn(name="supplier_id",referencedColumnName="id")
	@NotFound(action=NotFoundAction.IGNORE)
	private Supplier supplier;
	
	/**
	 * 所属产品
	 */
	@ManyToOne
	@JoinColumn(name="product_id",referencedColumnName="id")
	@NotFound(action=NotFoundAction.IGNORE)
	private Product product;
	
	/**
	 * 录入人
	 */
	@ManyToOne
	@JoinColumn(name="user_id",referencedColumnName="id")
	@NotFound(action=NotFoundAction.IGNORE)
	private User user;
	
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	/**
	 * 价格
	 */
	@Column(nullable=true)
	private Double price=0d;
	
	/**
	 * 品质规格
	 */
	@Column(length=200)
	private String qualitySpecifications;
	
	/**
	 * 外包装长
	 */
	@Column(nullable=true)
	private Double packingLong=0d;
	
	/**
	 * 外包装宽
	 */
	@Column(nullable=true)
	private Double packingWidth=0d;
	
	/**
	 * 外包装高
	 */
	@Column(nullable=true)
	private Double packingHeight=0d;
	
	/**
	 * 毛重
	 */
	@Column(nullable=true)
	private Double grossWeight=0d;
	
	/**
	 * 净重
	 */
	@Column(nullable=true)
	private Double netWeight=0d;
	
	/**
	 * 箱子数
	 */
	@Column
	private int boxes;
	
	/**
	 * 柜数量，不要了
	 */
//	@Column
//	private int cabinet;
	
	/**
	 * 报价时间
	 */
	@Temporal(TemporalType.TIMESTAMP)	
	private Date quoteTime;
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Supplier getSupplier() {
		return supplier;
	}

	public void setSupplier(Supplier supplier) {
		this.supplier = supplier;
	}

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public String getQualitySpecifications() {
		return qualitySpecifications;
	}

	public void setQualitySpecifications(String qualitySpecifications) {
		this.qualitySpecifications = qualitySpecifications;
	}

	public Double getPackingLong() {
		return packingLong;
	}

	public void setPackingLong(Double packingLong) {
		this.packingLong = packingLong;
	}

	public Double getPackingWidth() {
		return packingWidth;
	}

	public void setPackingWidth(Double packingWidth) {
		this.packingWidth = packingWidth;
	}

	public Double getPackingHeight() {
		return packingHeight;
	}

	public void setPackingHeight(Double packingHeight) {
		this.packingHeight = packingHeight;
	}

	public Double getGrossWeight() {
		return grossWeight;
	}

	public void setGrossWeight(Double grossWeight) {
		this.grossWeight = grossWeight;
	}

	public int getBoxes() {
		return boxes;
	}

	public void setBoxes(int boxes) {
		this.boxes = boxes;
	}

	
	public Date getQuoteTime() {
		return quoteTime;
	}

	public void setQuoteTime(Date quoteTime) {
		this.quoteTime = quoteTime;
	}
	
	public Double getNetWeight() {
		return netWeight;
	}

	public void setNetWeight(Double netWeight) {
		this.netWeight = netWeight;
	}

}
